package fan.project1_SpeedTalkSystem.Service;

import fan.project1_SpeedTalkSystem.Mapper.UserMapper;
import fan.project1_SpeedTalkSystem.Model.ProUserInfo;
import fan.project1_SpeedTalkSystem.Model.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {
    @Autowired
    UserMapper userMapper;

    public UserInfo getUserInfoByName(String userName) {
        return userMapper.getUserInfoByName(userName);
    }

    public ProUserInfo getProUserInfoById(Integer userId) {
        return ProUserInfo.ToProUserInfo(userMapper.getUserInfoById(userId));
    }

    public Integer insertUser(UserInfo newUser) {
        return userMapper.insertUser(newUser);
    }
}
